/*
 * FilterGraph.h
 *
 *  Created on: 2016年1月4日
 *      Author: terry
 */

#ifndef FILTERGRAPH_H_
#define FILTERGRAPH_H_

#include "MediaStream.h"
#include "AVFilterPtr.h"


namespace av
{


class FilterGraph
{
public:
	FilterGraph();
	virtual ~FilterGraph();

	int open(int width, int height, AVPixelFormat pixFmt, const std::string& filters);
	void close();
	bool isOpen();

	int filter(AVFrame* inFrame, AVFrame* outFrame);

	AVFilterGraphptr 	m_graph;
	AVFilterContextPtr    m_srcFilter;
	AVFilterContextPtr    m_sinkFilter;
	AVFilterInOutptr  m_filterOut;
	AVFilterInOutptr  m_filterIn;


};




} /* namespace av */

#endif /* FILTERGRAPH_H_ */
